package org.hfy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.hfy.dto.EmployeeQueryDTO;
import org.hfy.dto.OptionDTO;
import org.hfy.entity.Employee;

import java.util.List;

/**
 * 员工Mapper接口
 * 
 * @author hfy
 * @version 1.0
 */
@Mapper
public interface EmployeeMapper extends BaseMapper<Employee> {

    /**
     * 分页查询员工列表
     * 
     * @param page 分页参数
     * @param queryDTO 查询条件
     * @return 分页结果
     */
    IPage<Employee> selectEmployeePage(Page<Employee> page, @Param("query") EmployeeQueryDTO queryDTO);

    /**
     * 获取员工选项列表（用于下拉选择）
     * 
     * @return 员工选项列表
     */
    @Select("SELECT employee_code as code, employee_name as name FROM employees WHERE deleted = 0 AND status = 'active' ORDER BY employee_name")
    List<OptionDTO> selectEmployeeOptions();
} 